//###############
//FILE : FileToFileSession.java
//WRITER : Daniel Lowengrub, daniel_i_l, 320687098
//EXERCISE : oop ex3 2011
//DESCRIPTION:
//See below
//###############
package oop.ex3.protocol.sessions;

import java.io.DataOutputStream;
import java.io.IOException;

import oop.ex3.protocol.messages.Message;

/**
 * This is the base class for all sessions between two FMs.
 * It provides common functionality such as the cleanup method.
 * @author daniel_i_l
 *
 */
public abstract class FileToFileSession extends Session {

	public FileToFileSession(Message initialMessage) {
		super(initialMessage);
	}
	
	@Override
    protected void cleanup(DataOutputStream outputStream) {
        try {
            _errorMsg.send(outputStream);
        } catch (IOException ex) {
            //ex.printStackTrace();
            //nothing left to do after sending error message
        }
    }

}
